package com.diao.datahub;

import com.aliyun.datahub.client.DatahubClient;
import org.apache.commons.math3.fitting.leastsquares.EvaluationRmsChecker;
import org.apache.flink.streaming.api.functions.source.ParallelSourceFunction;
import org.apache.flink.streaming.api.functions.source.SourceFunction;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;


/**
 * @author: chenzhidiao
 * @date: 2021/6/10 14:21
 * @description:
 * @version: 1.0
 */

public class DatahubSource implements ParallelSourceFunction {
    private static Logger logger = LoggerFactory.getLogger(ParallelSourceFunction.class);

    private String endpoint;
    private String projectName;
    private String topicName;
    private String accessId=null;
    private String accessKey=null;


    //定义一个标记，决定数据是否继续生成
    private volatile Boolean flag = true;
    DatahubClient client = new DatahubUtils().getClient();
    @Override
    public void run(SourceContext ctx) throws Exception {
        if (flag){

        }

    }

    @Override
    public void cancel() {
        flag=false;
    }
}
